package com.winit.openapi.wh.builder;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.alibaba.dubbo.common.utils.CollectionUtils;
import com.alibaba.fastjson.JSONObject;
import com.winit.oms.spi.inbound.command.CreateOrUpdateDirectForcenoticeCommand;
import com.winit.oms.spi.inbound.vo.DirectInnerInboundOrderVo;
import com.winit.oms.spi.inbound.vo.DirectWhInboundOrderVo;
import com.winit.oms.spi.inbound.vo.InboundDispatchinfoVo;
import com.winit.oms.spi.inbound.vo.InboundEnumConstant;
import com.winit.oms.spi.inbound.vo.InboundMerchandiseDetailsVo;
import com.winit.oms.spi.inbound.vo.InboundOrderTrackingVo;
import com.winit.oms.spi.inbound.vo.InboundOrderVo;
import com.winit.oms.spi.inbound.vo.InboundPackageVo;
import com.winit.oms.spi.inbound.vo.StandardInboundOrderVo;
import com.winit.oms.spi.selfInspection.vo.SelfInspectionOrderVo;
import com.winit.openapi.exception.ApiException;
import com.winit.openapi.util.DateUtil;

/**
 * 海外仓入库单构造器
 * 
 * @version <pre>
 * Author     Version       Date        Changes
 * dinghua.an   1.0         2015年11月10日     Created
 *
 * </pre>
 * @since 1.
 */
public class SelfInspectionOrderBuilder {
    
    public static Map<String, Object> buildReturnSelfInspectionOrder(SelfInspectionOrderVo vo) {
    	Map<String, Object> map = new HashMap<String, Object>();
    	if(null == vo){
    		return map;
    	}
    	map.put("orderNo", vo.getWinitOrderNo());
    	map.put("warehouseEntryType",vo.getWarehouseEntryType() );
    	map.put("transportType", vo.getTransportType());
    	map.put("winitProductCode", vo.getWinitProductCode());
    	map.put("winitProductName", vo.getWinitProductName());
    	map.put("inspectionWarehouseCode", vo.getInspectionWhCode());
    	map.put("destinationWarehouseCode", vo.getDestinationWhCode());
    	map.put("inspectionWarehouseName", vo.getInspectionWhName());
    	map.put("destinationWarehouseName", vo.getDestinationWhName());
    	map.put("orderDate", vo.getCreated());
    	map.put("updated", vo.getUpdated());
    	map.put("status", vo.getInspectionStatus());
    	map.put("estimatePackageQty", vo.getEstimatePackageQty());
    	map.put("actualPackageQty", vo.getPackageQty());
    	map.put("estimateItemQty", vo.getEstimateItemQty());
    	map.put("actualItemQty", vo.getItemQty());
		return map;
    }

    
    public static List<Map<String, Object>> buildReturnSelfInspectionOrderList(List<SelfInspectionOrderVo> voList) {
    	List<Map<String, Object>> returnList = new ArrayList<Map<String, Object>>();
    	if(org.springframework.util.CollectionUtils.isEmpty(voList)){
    		return returnList;
    	}
    	for (SelfInspectionOrderVo vo : voList) {
    		returnList.add(buildReturnSelfInspectionOrder(vo));
		}
    	return returnList;
    }

}
